program Stol;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  n, i, k, s, r, xcount, y0, x0, ycount, outside, m :integer;
  xm, ym, xn, yn :array of integer;

begin
  readln(n);
  setlength(xn, m+1);
  setlength(yn, m+1);
  xcount:=0;
  ycount:=0;
  for i:=1 to n do
  begin
    writeln('Enter xn', i, ' yn', i);
    readln(xn[i]);
    readln(yn[i]);
    xcount:=xcount+xn[i];
    ycount:=ycount+yn[i];
  end;
  x0:=xcount/n;
  y0:=ycount/n;
  writeln('Enter n');
  readln(m);
  setlength(xm, m+1);
  setlength(ym, m+1);
  for i:=1 to m do
    begin
      writeln('Enter xm', i, ' ym', i);
      readln(xm[i]);
      readln(ym[i]);
    end;

  s:=0;
  for i:=2 to m-1 do
    begin
      s:=s+abs((xm[1]*ym[i]-xm[i]*ym[1])+(xm[i]*ym[i+1]-xm[i+1]*ym[i])+(xm[i+1]*ym[1]-xm[1]*ym[i+1]));
    end;

  outside:=0;
  r:=0;
  for i:=1 to m do
    begin
      k:=i+1;
      if (k>m) then k:=1;

      r:=r+abs((x0*ym[i]-xm[i]*y0)+(xm[i]*ym[k]-xm[k]*ym[i])+(xm[k]*y0-x0*ym[k]));
      if (r>s) then
      begin
        outside:=1;
        break;
      end;
    end;

  writeln;
  writeln(s);
  writeln(r);
  if (outside>0) then
    writeln('It is outside')
    else
    writeln('It is inside');
  readln;
end.
